
function GetSystemFileCount()
{
 	flashpoint();
  
   printf('# API: GetSystemFileCount() ');
   printf('# returns number of system files (in system folder )');
   printf(' ');
   
   writeMenu('"GetSystemFileCount"','"CMD"','"GetSystemFileCount()"' );
   writeVariables();

	printf('<br>','#**** OPEN FILE ****');
	printf('outFile="/System/zsysfc.txt"');
	writeFileOpen();

   printf('WriteLine(fd," ")');
   printf('WriteLine(fd," API: GetSystemFileCount() ")');
   printf('WriteLine(fd," returns number of system files (in system folder)")');
   printf('WriteLine(fd," ")');

   printf(' ');

	printf(' status=GetSystemFileCount( ucount ) ');
	printf(' ivar=ucount ');
	printf(' DisplayLine("GSFC[",status,"] ",ucount) ');
	printf(' WriteLine(fd, "GSFC[",status,"] ",ucount) ');
	printf(' Wait(2000) ');

	writeFileClose();
	printf(' exitscript ');
	
}



function GetSystemFileName()
{
	flashpoint();

	printf('#API: GetSystemFileName(file-index, filename) ');
	printf('# returns list of system files (in system folder)');
	printf('#OUTPUT FORMAT: ');
	printf('#GSFN[status] filename ');
	printf('#i.e. ');
	printf('#0)GSFN[0] GFINFO.CSM ');
	printf('#1)GSFN[0] GNFINFO.CSM ');
	printf('#2)GSFN[0] ERASE.CSM ');
	printf('#3)GSFN[0] STORSTAT.CSM ');
	printf('#4)GSFN[0] SETFTAG.CSM ');
	printf(' ');
	
   writeMenu('"GetSystemFileName"','"CMD"','"GetSystemFileName()"' );
   writeVariables();

	printf('<br>','#**** OPEN FILE ****');
	printf('outFile="/System/zsysfn.txt"');
	writeFileOpen();

	printf('WriteLine(fd," ")');
	printf('WriteLine(fd,"API: GetSystemFileName(file-index, filename) ")');
	printf('WriteLine(fd," returns list of system files (in system folder) ")');
	printf('WriteLine(fd,"OUTPUT FORMAT:  ")');
	printf('WriteLine(fd,"GSFN[status] filename  ")');
	printf('WriteLine(fd,"i.e.  ")');
	printf('WriteLine(fd,"0)GSFN[0] GFINFO.CSM  ")');
	printf('WriteLine(fd,"1)GSFN[0] GNFINFO.CSM  ")');
	printf('WriteLine(fd,"2)GSFN[0] ERASE.CSM  ")');
	printf('WriteLine(fd,"3)GSFN[0] STORSTAT.CSM  ")');
	printf('WriteLine(fd,"4)GSFN[0] SETFTAG.CSM  ")');
	printf('WriteLine(fd," ")');

	printf(' ');


	printf(' status=GetSystemFileCount( ucount ) ');
	printf(' ivar=ucount ');
	printf(' DisplayLine("GSFC[",status,"] ",ucount) ');
	printf(' WriteLine(fd, "GSFC[",status,"] ",ucount) ');
	printf(' Wait(2000) ');
	printf(' findex=0 ');
	printf(' ');
	printf(' LOOP: ');
	printf(' ');
	printf(' if ucount == 0 ');
	printf(' 	DisplayLine(" no files ") ');
	printf(' 	WriteLine(fd, "no files ") ');
	printf(' goto DONE ');
	printf(' end ');
	printf(' ');
	printf(' 	status = GetSystemFileName(findex,svar) ');
	printf(' 	DisplayLine(findex,")GSFN[",status,"] ",svar) ');
	printf(' 	WriteLine(fd, findex,")GSFN[",status,"] ",svar) ');
	printf(' ');
	printf(' 	Wait(100) ');
	printf(' ');

	printf(' if findex < ivar - 1 ');
	printf(' findex = findex + 1 ');
	printf(' goto LOOP ');
	printf(' end ');
	printf(' ');
	printf(' DONE: ');


	writeFileClose();
	printf(' exitscript ');
}
